<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title> 角色列表</title>
    <link rel="stylesheet" href="${base}/static/res/manage/css/common.css">
    <link rel="stylesheet" href="${base}/static/res/manage/css/ec.css">
    <link rel="stylesheet" href="${base}/static/res/manage/css/list.css">
    <script type="text/javascript" src="${base}/static/res/plugin/jquery/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/plugin/validator/jquery.validate.min.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/list.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/scrollView.js"></script>
    <script type="text/javascript" src="${base}/static/res/admin/js/initWidth.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
        [@flash_message /]

            $(".disabled,.launch").on("click", function () {
                var text = "";
                if ($(this).hasClass("launch")) {
                    text = "是否启用?";
                } else {
                    text = "是否禁用?";
                }
                if (confirm(text)) {
                    var id = $(this).attr("data-id");
                    var status = $(this).attr("data-status")
                    location.href = "disabledRole.jhtml?id=" + id+"&status="+status;
                }
            })
        });
    </script>
</head>
<body>
<div class="tab set">
    <h3>[#--<a href="javascript:;">首页</a>--]<a href="javascript:;">系统管理</a><a href="list.jhtml">> 角色管理</a></h3>
    <form id="listForm" action="list.jhtml" method="get">
        <div class="txte">
            <p class="txtl" ><a href="${base}/admin/role/add.jhtml" class="ared "> + 新建角色</a></p>
            <p class="txtp">
                <input type="text" name="roleName" id="roleName" value="${role.roleName}" placeholder="角色名称"
                       class="txt">
                <input type="submit" value="搜索" class="txt red">
            </p>
        </div>
        <div class="tablist">
            <table cellpadding="0" cellspacing="0" class="scrollTable" >
                <tr>
                    <th>角色名</th>
                    <th>是否可用</th>
                    <th>系统角色</th>
                    <th>创建时间</th>
                    <th class="icon">操作</th>
                </tr>
            [#list page.list as role]
                <tr>
                    <td>
                    ${role.roleName}
                    </td>
                    <td class="center">
                    ${stdCodeName("ROLE_STATUS",role.status)}
                    </td>
                    <td class="center">
                    ${role.isSystem?string("是","否")}
                    </td>
                    <td class="center">
                        <span title="${role.createDate?string("yyyy-MM-dd")}">${role.createDate?string("yyyy-MM-dd")}</span>
                    </td>
                    <td class="icon">
                        <div>
                            <a class="[#if role.status == 0]disabled[#elseif role.status == 1]launch[/#if]"
                               title="[#if role.status == 0]禁用[#elseif role.status == 1]启用[/#if]"
                               data-id="${role.id}" data-status="${role.status}" ></a>
                            <a class="delete" type="delOne" idName="id" idVal="${role.id}" title="删除"
                               href="javascript:void(0)"></a>
                            <a class="edit" title="编辑" href="edit.jhtml?id=${role.id}"></a>
                        </div>
                    </td>
                </tr>
            [/#list]
            </table>
        [@pagination pageNumber = page.pageNumber totalPages = page.pages]
            [#include "/admin/include/pagination.ftl"]
        [/@pagination]
        </div>
    </form>
</div>
</body>
</html>